/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: BitData.proto

package org.apache.drill.exec.proto;

public final class BitData {
  private BitData() {}
  public static void registerAllExtensions(
      com.google.protobuf.ExtensionRegistry registry) {
  }
  /**
   * Protobuf enum {@code exec.bit.data.RpcType}
   */
  public enum RpcType
      implements com.google.protobuf.ProtocolMessageEnum {
    /**
     * <code>HANDSHAKE = 0;</code>
     */
    HANDSHAKE(0, 0),
    /**
     * <code>ACK = 1;</code>
     */
    ACK(1, 1),
    /**
     * <code>GOODBYE = 2;</code>
     */
    GOODBYE(2, 2),
    /**
     * <code>REQ_RECORD_BATCH = 3;</code>
     *
     * <pre>
     * send record batch, returns Ack
     * </pre>
     */
    REQ_RECORD_BATCH(3, 3),
    /**
     * <code>SASL_MESSAGE = 4;</code>
     *
     * <pre>
     * both bit request and response
     * </pre>
     */
    SASL_MESSAGE(4, 4),
    ;

    /**
     * <code>HANDSHAKE = 0;</code>
     */
    public static final int HANDSHAKE_VALUE = 0;
    /**
     * <code>ACK = 1;</code>
     */
    public static final int ACK_VALUE = 1;
    /**
     * <code>GOODBYE = 2;</code>
     */
    public static final int GOODBYE_VALUE = 2;
    /**
     * <code>REQ_RECORD_BATCH = 3;</code>
     *
     * <pre>
     * send record batch, returns Ack
     * </pre>
     */
    public static final int REQ_RECORD_BATCH_VALUE = 3;
    /**
     * <code>SASL_MESSAGE = 4;</code>
     *
     * <pre>
     * both bit request and response
     * </pre>
     */
    public static final int SASL_MESSAGE_VALUE = 4;


    public final int getNumber() { return value; }

    public static RpcType valueOf(int value) {
      switch (value) {
        case 0: return HANDSHAKE;
        case 1: return ACK;
        case 2: return GOODBYE;
        case 3: return REQ_RECORD_BATCH;
        case 4: return SASL_MESSAGE;
        default: return null;
      }
    }

    public static com.google.protobuf.Internal.EnumLiteMap<RpcType>
        internalGetValueMap() {
      return internalValueMap;
    }
    private static com.google.protobuf.Internal.EnumLiteMap<RpcType>
        internalValueMap =
          new com.google.protobuf.Internal.EnumLiteMap<RpcType>() {
            public RpcType findValueByNumber(int number) {
              return RpcType.valueOf(number);
            }
          };

    public final com.google.protobuf.Descriptors.EnumValueDescriptor
        getValueDescriptor() {
      return getDescriptor().getValues().get(index);
    }
    public final com.google.protobuf.Descriptors.EnumDescriptor
        getDescriptorForType() {
      return getDescriptor();
    }
    public static final com.google.protobuf.Descriptors.EnumDescriptor
        getDescriptor() {
      return org.apache.drill.exec.proto.BitData.getDescriptor().getEnumTypes().get(0);
    }

    private static final RpcType[] VALUES = values();

    public static RpcType valueOf(
        com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
      if (desc.getType() != getDescriptor()) {
        throw new java.lang.IllegalArgumentException(
          "EnumValueDescriptor is not for this type.");
      }
      return VALUES[desc.getIndex()];
    }

    private final int index;
    private final int value;

    private RpcType(int index, int value) {
      this.index = index;
      this.value = value;
    }

    // @@protoc_insertion_point(enum_scope:exec.bit.data.RpcType)
  }

  public interface BitClientHandshakeOrBuilder
      extends com.google.protobuf.MessageOrBuilder {

    // optional int32 rpc_version = 1;
    /**
     * <code>optional int32 rpc_version = 1;</code>
     */
    boolean hasRpcVersion();
    /**
     * <code>optional int32 rpc_version = 1;</code>
     */
    int getRpcVersion();

    // optional .exec.shared.RpcChannel channel = 2 [default = BIT_DATA];
    /**
     * <code>optional .exec.shared.RpcChannel channel = 2 [default = BIT_DATA];</code>
     */
    boolean hasChannel();
    /**
     * <code>optional .exec.shared.RpcChannel channel = 2 [default = BIT_DATA];</code>
     */
    org.apache.drill.exec.proto.UserBitShared.RpcChannel getChannel();
  }
  /**
   * Protobuf type {@code exec.bit.data.BitClientHandshake}
   */
  public static final class BitClientHandshake extends
      com.google.protobuf.GeneratedMessage
      implements BitClientHandshakeOrBuilder {
    // Use BitClientHandshake.newBuilder() to construct.
    private BitClientHandshake(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
      super(builder);
      this.unknownFields = builder.getUnknownFields();
    }
    private BitClientHandshake(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }

    private static final BitClientHandshake defaultInstance;
    public static BitClientHandshake getDefaultInstance() {
      return defaultInstance;
    }

    public BitClientHandshake getDefaultInstanceForType() {
      return defaultInstance;
    }

    private final com.google.protobuf.UnknownFieldSet unknownFields;
    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
        getUnknownFields() {
      return this.unknownFields;
    }
    private BitClientHandshake(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      initFields();
      int mutable_bitField0_ = 0;
      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder();
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            default: {
              if (!parseUnknownField(input, unknownFields,
                                     extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
            case 8: {
              bitField0_ |= 0x00000001;
              rpcVersion_ = input.readInt32();
              break;
            }
            case 16: {
              int rawValue = input.readEnum();
              org.apache.drill.exec.proto.UserBitShared.RpcChannel value = org.apache.drill.exec.proto.UserBitShared.RpcChannel.valueOf(rawValue);
              if (value == null) {
                unknownFields.mergeVarintField(2, rawValue);
              } else {
                bitField0_ |= 0x00000002;
                channel_ = value;
              }
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e.getMessage()).setUnfinishedMessage(this);
      } finally {
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.apache.drill.exec.proto.BitData.internal_static_exec_bit_data_BitClientHandshake_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.apache.drill.exec.proto.BitData.internal_static_exec_bit_data_BitClientHandshake_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              org.apache.drill.exec.proto.BitData.BitClientHandshake.class, org.apache.drill.exec.proto.BitData.BitClientHandshake.Builder.class);
    }

    public static com.google.protobuf.Parser<BitClientHandshake> PARSER =
        new com.google.protobuf.AbstractParser<BitClientHandshake>() {
      public BitClientHandshake parsePartialFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return new BitClientHandshake(input, extensionRegistry);
      }
    };

    @java.lang.Override
    public com.google.protobuf.Parser<BitClientHandshake> getParserForType() {
      return PARSER;
    }

    private int bitField0_;
    // optional int32 rpc_version = 1;
    public static final int RPC_VERSION_FIELD_NUMBER = 1;
    private int rpcVersion_;
    /**
     * <code>optional int32 rpc_version = 1;</code>
     */
    public boolean hasRpcVersion() {
      return ((bitField0_ & 0x00000001) == 0x00000001);
    }
    /**
     * <code>optional int32 rpc_version = 1;</code>
     */
    public int getRpcVersion() {
      return rpcVersion_;
    }

    // optional .exec.shared.RpcChannel channel = 2 [default = BIT_DATA];
    public static final int CHANNEL_FIELD_NUMBER = 2;
    private org.apache.drill.exec.proto.UserBitShared.RpcChannel channel_;
    /**
     * <code>optional .exec.shared.RpcChannel channel = 2 [default = BIT_DATA];</code>
     */
    public boolean hasChannel() {
      return ((bitField0_ & 0x00000002) == 0x00000002);
    }
    /**
     * <code>optional .exec.shared.RpcChannel channel = 2 [default = BIT_DATA];</code>
     */
    public org.apache.drill.exec.proto.UserBitShared.RpcChannel getChannel() {
      return channel_;
    }

    private void initFields() {
      rpcVersion_ = 0;
      channel_ = org.apache.drill.exec.proto.UserBitShared.RpcChannel.BIT_DATA;
    }
    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized != -1) return isInitialized == 1;

      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        output.writeInt32(1, rpcVersion_);
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        output.writeEnum(2, channel_.getNumber());
      }
      getUnknownFields().writeTo(output);
    }

    private int memoizedSerializedSize = -1;
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt32Size(1, rpcVersion_);
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        size += com.google.protobuf.CodedOutputStream
          .computeEnumSize(2, channel_.getNumber());
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    protected java.lang.Object writeReplace()
        throws java.io.ObjectStreamException {
      return super.writeReplace();
    }

    public static org.apache.drill.exec.proto.BitData.BitClientHandshake parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static org.apache.drill.exec.proto.BitData.BitClientHandshake parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static org.apache.drill.exec.proto.BitData.BitClientHandshake parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static org.apache.drill.exec.proto.BitData.BitClientHandshake parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static org.apache.drill.exec.proto.BitData.BitClientHandshake parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static org.apache.drill.exec.proto.BitData.BitClientHandshake parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }
    public static org.apache.drill.exec.proto.BitData.BitClientHandshake parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input);
    }
    public static org.apache.drill.exec.proto.BitData.BitClientHandshake parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input, extensionRegistry);
    }
    public static org.apache.drill.exec.proto.BitData.BitClientHandshake parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static org.apache.drill.exec.proto.BitData.BitClientHandshake parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }

    public static Builder newBuilder() { return Builder.create(); }
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder(org.apache.drill.exec.proto.BitData.BitClientHandshake prototype) {
      return newBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() { return newBuilder(this); }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code exec.bit.data.BitClientHandshake}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder>
       implements org.apache.drill.exec.proto.BitData.BitClientHandshakeOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return org.apache.drill.exec.proto.BitData.internal_static_exec_bit_data_BitClientHandshake_descriptor;
      }

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return org.apache.drill.exec.proto.BitData.internal_static_exec_bit_data_BitClientHandshake_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                org.apache.drill.exec.proto.BitData.BitClientHandshake.class, org.apache.drill.exec.proto.BitData.BitClientHandshake.Builder.class);
      }

      // Construct using org.apache.drill.exec.proto.BitData.BitClientHandshake.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
        }
      }
      private static Builder create() {
        return new Builder();
      }

      public Builder clear() {
        super.clear();
        rpcVersion_ = 0;
        bitField0_ = (bitField0_ & ~0x00000001);
        channel_ = org.apache.drill.exec.proto.UserBitShared.RpcChannel.BIT_DATA;
        bitField0_ = (bitField0_ & ~0x00000002);
        return this;
      }

      public Builder clone() {
        return create().mergeFrom(buildPartial());
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return org.apache.drill.exec.proto.BitData.internal_static_exec_bit_data_BitClientHandshake_descriptor;
      }

      public org.apache.drill.exec.proto.BitData.BitClientHandshake getDefaultInstanceForType() {
        return org.apache.drill.exec.proto.BitData.BitClientHandshake.getDefaultInstance();
      }

      public org.apache.drill.exec.proto.BitData.BitClientHandshake build() {
        org.apache.drill.exec.proto.BitData.BitClientHandshake result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public org.apache.drill.exec.proto.BitData.BitClientHandshake buildPartial() {
        org.apache.drill.exec.proto.BitData.BitClientHandshake result = new org.apache.drill.exec.proto.BitData.BitClientHandshake(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
          to_bitField0_ |= 0x00000001;
        }
        result.rpcVersion_ = rpcVersion_;
        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
          to_bitField0_ |= 0x00000002;
        }
        result.channel_ = channel_;
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof org.apache.drill.exec.proto.BitData.BitClientHandshake) {
          return mergeFrom((org.apache.drill.exec.proto.BitData.BitClientHandshake)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(org.apache.drill.exec.proto.BitData.BitClientHandshake other) {
        if (other == org.apache.drill.exec.proto.BitData.BitClientHandshake.getDefaultInstance()) return this;
        if (other.hasRpcVersion()) {
          setRpcVersion(other.getRpcVersion());
        }
        if (other.hasChannel()) {
          setChannel(other.getChannel());
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }

      public final boolean isInitialized() {
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        org.apache.drill.exec.proto.BitData.BitClientHandshake parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (org.apache.drill.exec.proto.BitData.BitClientHandshake) e.getUnfinishedMessage();
          throw e;
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      // optional int32 rpc_version = 1;
      private int rpcVersion_ ;
      /**
       * <code>optional int32 rpc_version = 1;</code>
       */
      public boolean hasRpcVersion() {
        return ((bitField0_ & 0x00000001) == 0x00000001);
      }
      /**
       * <code>optional int32 rpc_version = 1;</code>
       */
      public int getRpcVersion() {
        return rpcVersion_;
      }
      /**
       * <code>optional int32 rpc_version = 1;</code>
       */
      public Builder setRpcVersion(int value) {
        bitField0_ |= 0x00000001;
        rpcVersion_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional int32 rpc_version = 1;</code>
       */
      public Builder clearRpcVersion() {
        bitField0_ = (bitField0_ & ~0x00000001);
        rpcVersion_ = 0;
        onChanged();
        return this;
      }

      // optional .exec.shared.RpcChannel channel = 2 [default = BIT_DATA];
      private org.apache.drill.exec.proto.UserBitShared.RpcChannel channel_ = org.apache.drill.exec.proto.UserBitShared.RpcChannel.BIT_DATA;
      /**
       * <code>optional .exec.shared.RpcChannel channel = 2 [default = BIT_DATA];</code>
       */
      public boolean hasChannel() {
        return ((bitField0_ & 0x00000002) == 0x00000002);
      }
      /**
       * <code>optional .exec.shared.RpcChannel channel = 2 [default = BIT_DATA];</code>
       */
      public org.apache.drill.exec.proto.UserBitShared.RpcChannel getChannel() {
        return channel_;
      }
      /**
       * <code>optional .exec.shared.RpcChannel channel = 2 [default = BIT_DATA];</code>
       */
      public Builder setChannel(org.apache.drill.exec.proto.UserBitShared.RpcChannel value) {
        if (value == null) {
          throw new NullPointerException();
        }
        bitField0_ |= 0x00000002;
        channel_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional .exec.shared.RpcChannel channel = 2 [default = BIT_DATA];</code>
       */
      public Builder clearChannel() {
        bitField0_ = (bitField0_ & ~0x00000002);
        channel_ = org.apache.drill.exec.proto.UserBitShared.RpcChannel.BIT_DATA;
        onChanged();
        return this;
      }

      // @@protoc_insertion_point(builder_scope:exec.bit.data.BitClientHandshake)
    }

    static {
      defaultInstance = new BitClientHandshake(true);
      defaultInstance.initFields();
    }

    // @@protoc_insertion_point(class_scope:exec.bit.data.BitClientHandshake)
  }

  public interface BitServerHandshakeOrBuilder
      extends com.google.protobuf.MessageOrBuilder {

    // optional int32 rpc_version = 1;
    /**
     * <code>optional int32 rpc_version = 1;</code>
     */
    boolean hasRpcVersion();
    /**
     * <code>optional int32 rpc_version = 1;</code>
     */
    int getRpcVersion();

    // repeated string authenticationMechanisms = 2;
    /**
     * <code>repeated string authenticationMechanisms = 2;</code>
     */
    java.util.List<java.lang.String>
    getAuthenticationMechanismsList();
    /**
     * <code>repeated string authenticationMechanisms = 2;</code>
     */
    int getAuthenticationMechanismsCount();
    /**
     * <code>repeated string authenticationMechanisms = 2;</code>
     */
    java.lang.String getAuthenticationMechanisms(int index);
    /**
     * <code>repeated string authenticationMechanisms = 2;</code>
     */
    com.google.protobuf.ByteString
        getAuthenticationMechanismsBytes(int index);
  }
  /**
   * Protobuf type {@code exec.bit.data.BitServerHandshake}
   */
  public static final class BitServerHandshake extends
      com.google.protobuf.GeneratedMessage
      implements BitServerHandshakeOrBuilder {
    // Use BitServerHandshake.newBuilder() to construct.
    private BitServerHandshake(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
      super(builder);
      this.unknownFields = builder.getUnknownFields();
    }
    private BitServerHandshake(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }

    private static final BitServerHandshake defaultInstance;
    public static BitServerHandshake getDefaultInstance() {
      return defaultInstance;
    }

    public BitServerHandshake getDefaultInstanceForType() {
      return defaultInstance;
    }

    private final com.google.protobuf.UnknownFieldSet unknownFields;
    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
        getUnknownFields() {
      return this.unknownFields;
    }
    private BitServerHandshake(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      initFields();
      int mutable_bitField0_ = 0;
      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder();
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            default: {
              if (!parseUnknownField(input, unknownFields,
                                     extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
            case 8: {
              bitField0_ |= 0x00000001;
              rpcVersion_ = input.readInt32();
              break;
            }
            case 18: {
              if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
                authenticationMechanisms_ = new com.google.protobuf.LazyStringArrayList();
                mutable_bitField0_ |= 0x00000002;
              }
              authenticationMechanisms_.add(input.readBytes());
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e.getMessage()).setUnfinishedMessage(this);
      } finally {
        if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
          authenticationMechanisms_ = new com.google.protobuf.UnmodifiableLazyStringList(authenticationMechanisms_);
        }
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.apache.drill.exec.proto.BitData.internal_static_exec_bit_data_BitServerHandshake_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.apache.drill.exec.proto.BitData.internal_static_exec_bit_data_BitServerHandshake_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              org.apache.drill.exec.proto.BitData.BitServerHandshake.class, org.apache.drill.exec.proto.BitData.BitServerHandshake.Builder.class);
    }

    public static com.google.protobuf.Parser<BitServerHandshake> PARSER =
        new com.google.protobuf.AbstractParser<BitServerHandshake>() {
      public BitServerHandshake parsePartialFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return new BitServerHandshake(input, extensionRegistry);
      }
    };

    @java.lang.Override
    public com.google.protobuf.Parser<BitServerHandshake> getParserForType() {
      return PARSER;
    }

    private int bitField0_;
    // optional int32 rpc_version = 1;
    public static final int RPC_VERSION_FIELD_NUMBER = 1;
    private int rpcVersion_;
    /**
     * <code>optional int32 rpc_version = 1;</code>
     */
    public boolean hasRpcVersion() {
      return ((bitField0_ & 0x00000001) == 0x00000001);
    }
    /**
     * <code>optional int32 rpc_version = 1;</code>
     */
    public int getRpcVersion() {
      return rpcVersion_;
    }

    // repeated string authenticationMechanisms = 2;
    public static final int AUTHENTICATIONMECHANISMS_FIELD_NUMBER = 2;
    private com.google.protobuf.LazyStringList authenticationMechanisms_;
    /**
     * <code>repeated string authenticationMechanisms = 2;</code>
     */
    public java.util.List<java.lang.String>
        getAuthenticationMechanismsList() {
      return authenticationMechanisms_;
    }
    /**
     * <code>repeated string authenticationMechanisms = 2;</code>
     */
    public int getAuthenticationMechanismsCount() {
      return authenticationMechanisms_.size();
    }
    /**
     * <code>repeated string authenticationMechanisms = 2;</code>
     */
    public java.lang.String getAuthenticationMechanisms(int index) {
      return authenticationMechanisms_.get(index);
    }
    /**
     * <code>repeated string authenticationMechanisms = 2;</code>
     */
    public com.google.protobuf.ByteString
        getAuthenticationMechanismsBytes(int index) {
      return authenticationMechanisms_.getByteString(index);
    }

    private void initFields() {
      rpcVersion_ = 0;
      authenticationMechanisms_ = com.google.protobuf.LazyStringArrayList.EMPTY;
    }
    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized != -1) return isInitialized == 1;

      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        output.writeInt32(1, rpcVersion_);
      }
      for (int i = 0; i < authenticationMechanisms_.size(); i++) {
        output.writeBytes(2, authenticationMechanisms_.getByteString(i));
      }
      getUnknownFields().writeTo(output);
    }

    private int memoizedSerializedSize = -1;
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt32Size(1, rpcVersion_);
      }
      {
        int dataSize = 0;
        for (int i = 0; i < authenticationMechanisms_.size(); i++) {
          dataSize += com.google.protobuf.CodedOutputStream
            .computeBytesSizeNoTag(authenticationMechanisms_.getByteString(i));
        }
        size += dataSize;
        size += 1 * getAuthenticationMechanismsList().size();
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    protected java.lang.Object writeReplace()
        throws java.io.ObjectStreamException {
      return super.writeReplace();
    }

    public static org.apache.drill.exec.proto.BitData.BitServerHandshake parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static org.apache.drill.exec.proto.BitData.BitServerHandshake parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static org.apache.drill.exec.proto.BitData.BitServerHandshake parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static org.apache.drill.exec.proto.BitData.BitServerHandshake parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static org.apache.drill.exec.proto.BitData.BitServerHandshake parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static org.apache.drill.exec.proto.BitData.BitServerHandshake parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }
    public static org.apache.drill.exec.proto.BitData.BitServerHandshake parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input);
    }
    public static org.apache.drill.exec.proto.BitData.BitServerHandshake parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input, extensionRegistry);
    }
    public static org.apache.drill.exec.proto.BitData.BitServerHandshake parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static org.apache.drill.exec.proto.BitData.BitServerHandshake parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }

    public static Builder newBuilder() { return Builder.create(); }
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder(org.apache.drill.exec.proto.BitData.BitServerHandshake prototype) {
      return newBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() { return newBuilder(this); }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code exec.bit.data.BitServerHandshake}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder>
       implements org.apache.drill.exec.proto.BitData.BitServerHandshakeOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return org.apache.drill.exec.proto.BitData.internal_static_exec_bit_data_BitServerHandshake_descriptor;
      }

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return org.apache.drill.exec.proto.BitData.internal_static_exec_bit_data_BitServerHandshake_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                org.apache.drill.exec.proto.BitData.BitServerHandshake.class, org.apache.drill.exec.proto.BitData.BitServerHandshake.Builder.class);
      }

      // Construct using org.apache.drill.exec.proto.BitData.BitServerHandshake.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
        }
      }
      private static Builder create() {
        return new Builder();
      }

      public Builder clear() {
        super.clear();
        rpcVersion_ = 0;
        bitField0_ = (bitField0_ & ~0x00000001);
        authenticationMechanisms_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        bitField0_ = (bitField0_ & ~0x00000002);
        return this;
      }

      public Builder clone() {
        return create().mergeFrom(buildPartial());
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return org.apache.drill.exec.proto.BitData.internal_static_exec_bit_data_BitServerHandshake_descriptor;
      }

      public org.apache.drill.exec.proto.BitData.BitServerHandshake getDefaultInstanceForType() {
        return org.apache.drill.exec.proto.BitData.BitServerHandshake.getDefaultInstance();
      }

      public org.apache.drill.exec.proto.BitData.BitServerHandshake build() {
        org.apache.drill.exec.proto.BitData.BitServerHandshake result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public org.apache.drill.exec.proto.BitData.BitServerHandshake buildPartial() {
        org.apache.drill.exec.proto.BitData.BitServerHandshake result = new org.apache.drill.exec.proto.BitData.BitServerHandshake(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
          to_bitField0_ |= 0x00000001;
        }
        result.rpcVersion_ = rpcVersion_;
        if (((bitField0_ & 0x00000002) == 0x00000002)) {
          authenticationMechanisms_ = new com.google.protobuf.UnmodifiableLazyStringList(
              authenticationMechanisms_);
          bitField0_ = (bitField0_ & ~0x00000002);
        }
        result.authenticationMechanisms_ = authenticationMechanisms_;
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof org.apache.drill.exec.proto.BitData.BitServerHandshake) {
          return mergeFrom((org.apache.drill.exec.proto.BitData.BitServerHandshake)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(org.apache.drill.exec.proto.BitData.BitServerHandshake other) {
        if (other == org.apache.drill.exec.proto.BitData.BitServerHandshake.getDefaultInstance()) return this;
        if (other.hasRpcVersion()) {
          setRpcVersion(other.getRpcVersion());
        }
        if (!other.authenticationMechanisms_.isEmpty()) {
          if (authenticationMechanisms_.isEmpty()) {
            authenticationMechanisms_ = other.authenticationMechanisms_;
            bitField0_ = (bitField0_ & ~0x00000002);
          } else {
            ensureAuthenticationMechanismsIsMutable();
            authenticationMechanisms_.addAll(other.authenticationMechanisms_);
          }
          onChanged();
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }

      public final boolean isInitialized() {
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        org.apache.drill.exec.proto.BitData.BitServerHandshake parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (org.apache.drill.exec.proto.BitData.BitServerHandshake) e.getUnfinishedMessage();
          throw e;
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      // optional int32 rpc_version = 1;
      private int rpcVersion_ ;
      /**
       * <code>optional int32 rpc_version = 1;</code>
       */
      public boolean hasRpcVersion() {
        return ((bitField0_ & 0x00000001) == 0x00000001);
      }
      /**
       * <code>optional int32 rpc_version = 1;</code>
       */
      public int getRpcVersion() {
        return rpcVersion_;
      }
      /**
       * <code>optional int32 rpc_version = 1;</code>
       */
      public Builder setRpcVersion(int value) {
        bitField0_ |= 0x00000001;
        rpcVersion_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional int32 rpc_version = 1;</code>
       */
      public Builder clearRpcVersion() {
        bitField0_ = (bitField0_ & ~0x00000001);
        rpcVersion_ = 0;
        onChanged();
        return this;
      }

      // repeated string authenticationMechanisms = 2;
      private com.google.protobuf.LazyStringList authenticationMechanisms_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      private void ensureAuthenticationMechanismsIsMutable() {
        if (!((bitField0_ & 0x00000002) == 0x00000002)) {
          authenticationMechanisms_ = new com.google.protobuf.LazyStringArrayList(authenticationMechanisms_);
          bitField0_ |= 0x00000002;
         }
      }
      /**
       * <code>repeated string authenticationMechanisms = 2;</code>
       */
      public java.util.List<java.lang.String>
          getAuthenticationMechanismsList() {
        return java.util.Collections.unmodifiableList(authenticationMechanisms_);
      }
      /**
       * <code>repeated string authenticationMechanisms = 2;</code>
       */
      public int getAuthenticationMechanismsCount() {
        return authenticationMechanisms_.size();
      }
      /**
       * <code>repeated string authenticationMechanisms = 2;</code>
       */
      public java.lang.String getAuthenticationMechanisms(int index) {
        return authenticationMechanisms_.get(index);
      }
      /**
       * <code>repeated string authenticationMechanisms = 2;</code>
       */
      public com.google.protobuf.ByteString
          getAuthenticationMechanismsBytes(int index) {
        return authenticationMechanisms_.getByteString(index);
      }
      /**
       * <code>repeated string authenticationMechanisms = 2;</code>
       */
      public Builder setAuthenticationMechanisms(
          int index, java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  ensureAuthenticationMechanismsIsMutable();
        authenticationMechanisms_.set(index, value);
        onChanged();
        return this;
      }
      /**
       * <code>repeated string authenticationMechanisms = 2;</code>
       */
      public Builder addAuthenticationMechanisms(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  ensureAuthenticationMechanismsIsMutable();
        authenticationMechanisms_.add(value);
        onChanged();
        return this;
      }
      /**
       * <code>repeated string authenticationMechanisms = 2;</code>
       */
      public Builder addAllAuthenticationMechanisms(
          java.lang.Iterable<java.lang.String> values) {
        ensureAuthenticationMechanismsIsMutable();
        super.addAll(values, authenticationMechanisms_);
        onChanged();
        return this;
      }
      /**
       * <code>repeated string authenticationMechanisms = 2;</code>
       */
      public Builder clearAuthenticationMechanisms() {
        authenticationMechanisms_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        bitField0_ = (bitField0_ & ~0x00000002);
        onChanged();
        return this;
      }
      /**
       * <code>repeated string authenticationMechanisms = 2;</code>
       */
      public Builder addAuthenticationMechanismsBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  ensureAuthenticationMechanismsIsMutable();
        authenticationMechanisms_.add(value);
        onChanged();
        return this;
      }

      // @@protoc_insertion_point(builder_scope:exec.bit.data.BitServerHandshake)
    }

    static {
      defaultInstance = new BitServerHandshake(true);
      defaultInstance.initFields();
    }

    // @@protoc_insertion_point(class_scope:exec.bit.data.BitServerHandshake)
  }

  public interface FragmentRecordBatchOrBuilder
      extends com.google.protobuf.MessageOrBuilder {

    // optional .exec.shared.QueryId query_id = 1;
    /**
     * <code>optional .exec.shared.QueryId query_id = 1;</code>
     */
    boolean hasQueryId();
    /**
     * <code>optional .exec.shared.QueryId query_id = 1;</code>
     */
    org.apache.drill.exec.proto.UserBitShared.QueryId getQueryId();
    /**
     * <code>optional .exec.shared.QueryId query_id = 1;</code>
     */
    org.apache.drill.exec.proto.UserBitShared.QueryIdOrBuilder getQueryIdOrBuilder();

    // optional int32 receiving_major_fragment_id = 2;
    /**
     * <code>optional int32 receiving_major_fragment_id = 2;</code>
     */
    boolean hasReceivingMajorFragmentId();
    /**
     * <code>optional int32 receiving_major_fragment_id = 2;</code>
     */
    int getReceivingMajorFragmentId();

    // repeated int32 receiving_minor_fragment_id = 3;
    /**
     * <code>repeated int32 receiving_minor_fragment_id = 3;</code>
     */
    java.util.List<java.lang.Integer> getReceivingMinorFragmentIdList();
    /**
     * <code>repeated int32 receiving_minor_fragment_id = 3;</code>
     */
    int getReceivingMinorFragmentIdCount();
    /**
     * <code>repeated int32 receiving_minor_fragment_id = 3;</code>
     */
    int getReceivingMinorFragmentId(int index);

    // optional int32 sending_major_fragment_id = 4;
    /**
     * <code>optional int32 sending_major_fragment_id = 4;</code>
     */
    boolean hasSendingMajorFragmentId();
    /**
     * <code>optional int32 sending_major_fragment_id = 4;</code>
     */
    int getSendingMajorFragmentId();

    // optional int32 sending_minor_fragment_id = 5;
    /**
     * <code>optional int32 sending_minor_fragment_id = 5;</code>
     */
    boolean hasSendingMinorFragmentId();
    /**
     * <code>optional int32 sending_minor_fragment_id = 5;</code>
     */
    int getSendingMinorFragmentId();

    // optional .exec.shared.RecordBatchDef def = 6;
    /**
     * <code>optional .exec.shared.RecordBatchDef def = 6;</code>
     */
    boolean hasDef();
    /**
     * <code>optional .exec.shared.RecordBatchDef def = 6;</code>
     */
    org.apache.drill.exec.proto.UserBitShared.RecordBatchDef getDef();
    /**
     * <code>optional .exec.shared.RecordBatchDef def = 6;</code>
     */
    org.apache.drill.exec.proto.UserBitShared.RecordBatchDefOrBuilder getDefOrBuilder();

    // optional bool isLastBatch = 7;
    /**
     * <code>optional bool isLastBatch = 7;</code>
     */
    boolean hasIsLastBatch();
    /**
     * <code>optional bool isLastBatch = 7;</code>
     */
    boolean getIsLastBatch();
  }
  /**
   * Protobuf type {@code exec.bit.data.FragmentRecordBatch}
   */
  public static final class FragmentRecordBatch extends
      com.google.protobuf.GeneratedMessage
      implements FragmentRecordBatchOrBuilder {
    // Use FragmentRecordBatch.newBuilder() to construct.
    private FragmentRecordBatch(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
      super(builder);
      this.unknownFields = builder.getUnknownFields();
    }
    private FragmentRecordBatch(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }

    private static final FragmentRecordBatch defaultInstance;
    public static FragmentRecordBatch getDefaultInstance() {
      return defaultInstance;
    }

    public FragmentRecordBatch getDefaultInstanceForType() {
      return defaultInstance;
    }

    private final com.google.protobuf.UnknownFieldSet unknownFields;
    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
        getUnknownFields() {
      return this.unknownFields;
    }
    private FragmentRecordBatch(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      initFields();
      int mutable_bitField0_ = 0;
      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder();
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            default: {
              if (!parseUnknownField(input, unknownFields,
                                     extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
            case 10: {
              org.apache.drill.exec.proto.UserBitShared.QueryId.Builder subBuilder = null;
              if (((bitField0_ & 0x00000001) == 0x00000001)) {
                subBuilder = queryId_.toBuilder();
              }
              queryId_ = input.readMessage(org.apache.drill.exec.proto.UserBitShared.QueryId.PARSER, extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(queryId_);
                queryId_ = subBuilder.buildPartial();
              }
              bitField0_ |= 0x00000001;
              break;
            }
            case 16: {
              bitField0_ |= 0x00000002;
              receivingMajorFragmentId_ = input.readInt32();
              break;
            }
            case 24: {
              if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
                receivingMinorFragmentId_ = new java.util.ArrayList<java.lang.Integer>();
                mutable_bitField0_ |= 0x00000004;
              }
              receivingMinorFragmentId_.add(input.readInt32());
              break;
            }
            case 26: {
              int length = input.readRawVarint32();
              int limit = input.pushLimit(length);
              if (!((mutable_bitField0_ & 0x00000004) == 0x00000004) && input.getBytesUntilLimit() > 0) {
                receivingMinorFragmentId_ = new java.util.ArrayList<java.lang.Integer>();
                mutable_bitField0_ |= 0x00000004;
              }
              while (input.getBytesUntilLimit() > 0) {
                receivingMinorFragmentId_.add(input.readInt32());
              }
              input.popLimit(limit);
              break;
            }
            case 32: {
              bitField0_ |= 0x00000004;
              sendingMajorFragmentId_ = input.readInt32();
              break;
            }
            case 40: {
              bitField0_ |= 0x00000008;
              sendingMinorFragmentId_ = input.readInt32();
              break;
            }
            case 50: {
              org.apache.drill.exec.proto.UserBitShared.RecordBatchDef.Builder subBuilder = null;
              if (((bitField0_ & 0x00000010) == 0x00000010)) {
                subBuilder = def_.toBuilder();
              }
              def_ = input.readMessage(org.apache.drill.exec.proto.UserBitShared.RecordBatchDef.PARSER, extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(def_);
                def_ = subBuilder.buildPartial();
              }
              bitField0_ |= 0x00000010;
              break;
            }
            case 56: {
              bitField0_ |= 0x00000020;
              isLastBatch_ = input.readBool();
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e.getMessage()).setUnfinishedMessage(this);
      } finally {
        if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
          receivingMinorFragmentId_ = java.util.Collections.unmodifiableList(receivingMinorFragmentId_);
        }
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.apache.drill.exec.proto.BitData.internal_static_exec_bit_data_FragmentRecordBatch_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.apache.drill.exec.proto.BitData.internal_static_exec_bit_data_FragmentRecordBatch_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              org.apache.drill.exec.proto.BitData.FragmentRecordBatch.class, org.apache.drill.exec.proto.BitData.FragmentRecordBatch.Builder.class);
    }

    public static com.google.protobuf.Parser<FragmentRecordBatch> PARSER =
        new com.google.protobuf.AbstractParser<FragmentRecordBatch>() {
      public FragmentRecordBatch parsePartialFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return new FragmentRecordBatch(input, extensionRegistry);
      }
    };

    @java.lang.Override
    public com.google.protobuf.Parser<FragmentRecordBatch> getParserForType() {
      return PARSER;
    }

    private int bitField0_;
    // optional .exec.shared.QueryId query_id = 1;
    public static final int QUERY_ID_FIELD_NUMBER = 1;
    private org.apache.drill.exec.proto.UserBitShared.QueryId queryId_;
    /**
     * <code>optional .exec.shared.QueryId query_id = 1;</code>
     */
    public boolean hasQueryId() {
      return ((bitField0_ & 0x00000001) == 0x00000001);
    }
    /**
     * <code>optional .exec.shared.QueryId query_id = 1;</code>
     */
    public org.apache.drill.exec.proto.UserBitShared.QueryId getQueryId() {
      return queryId_;
    }
    /**
     * <code>optional .exec.shared.QueryId query_id = 1;</code>
     */
    public org.apache.drill.exec.proto.UserBitShared.QueryIdOrBuilder getQueryIdOrBuilder() {
      return queryId_;
    }

    // optional int32 receiving_major_fragment_id = 2;
    public static final int RECEIVING_MAJOR_FRAGMENT_ID_FIELD_NUMBER = 2;
    private int receivingMajorFragmentId_;
    /**
     * <code>optional int32 receiving_major_fragment_id = 2;</code>
     */
    public boolean hasReceivingMajorFragmentId() {
      return ((bitField0_ & 0x00000002) == 0x00000002);
    }
    /**
     * <code>optional int32 receiving_major_fragment_id = 2;</code>
     */
    public int getReceivingMajorFragmentId() {
      return receivingMajorFragmentId_;
    }

    // repeated int32 receiving_minor_fragment_id = 3;
    public static final int RECEIVING_MINOR_FRAGMENT_ID_FIELD_NUMBER = 3;
    private java.util.List<java.lang.Integer> receivingMinorFragmentId_;
    /**
     * <code>repeated int32 receiving_minor_fragment_id = 3;</code>
     */
    public java.util.List<java.lang.Integer>
        getReceivingMinorFragmentIdList() {
      return receivingMinorFragmentId_;
    }
    /**
     * <code>repeated int32 receiving_minor_fragment_id = 3;</code>
     */
    public int getReceivingMinorFragmentIdCount() {
      return receivingMinorFragmentId_.size();
    }
    /**
     * <code>repeated int32 receiving_minor_fragment_id = 3;</code>
     */
    public int getReceivingMinorFragmentId(int index) {
      return receivingMinorFragmentId_.get(index);
    }

    // optional int32 sending_major_fragment_id = 4;
    public static final int SENDING_MAJOR_FRAGMENT_ID_FIELD_NUMBER = 4;
    private int sendingMajorFragmentId_;
    /**
     * <code>optional int32 sending_major_fragment_id = 4;</code>
     */
    public boolean hasSendingMajorFragmentId() {
      return ((bitField0_ & 0x00000004) == 0x00000004);
    }
    /**
     * <code>optional int32 sending_major_fragment_id = 4;</code>
     */
    public int getSendingMajorFragmentId() {
      return sendingMajorFragmentId_;
    }

    // optional int32 sending_minor_fragment_id = 5;
    public static final int SENDING_MINOR_FRAGMENT_ID_FIELD_NUMBER = 5;
    private int sendingMinorFragmentId_;
    /**
     * <code>optional int32 sending_minor_fragment_id = 5;</code>
     */
    public boolean hasSendingMinorFragmentId() {
      return ((bitField0_ & 0x00000008) == 0x00000008);
    }
    /**
     * <code>optional int32 sending_minor_fragment_id = 5;</code>
     */
    public int getSendingMinorFragmentId() {
      return sendingMinorFragmentId_;
    }

    // optional .exec.shared.RecordBatchDef def = 6;
    public static final int DEF_FIELD_NUMBER = 6;
    private org.apache.drill.exec.proto.UserBitShared.RecordBatchDef def_;
    /**
     * <code>optional .exec.shared.RecordBatchDef def = 6;</code>
     */
    public boolean hasDef() {
      return ((bitField0_ & 0x00000010) == 0x00000010);
    }
    /**
     * <code>optional .exec.shared.RecordBatchDef def = 6;</code>
     */
    public org.apache.drill.exec.proto.UserBitShared.RecordBatchDef getDef() {
      return def_;
    }
    /**
     * <code>optional .exec.shared.RecordBatchDef def = 6;</code>
     */
    public org.apache.drill.exec.proto.UserBitShared.RecordBatchDefOrBuilder getDefOrBuilder() {
      return def_;
    }

    // optional bool isLastBatch = 7;
    public static final int ISLASTBATCH_FIELD_NUMBER = 7;
    private boolean isLastBatch_;
    /**
     * <code>optional bool isLastBatch = 7;</code>
     */
    public boolean hasIsLastBatch() {
      return ((bitField0_ & 0x00000020) == 0x00000020);
    }
    /**
     * <code>optional bool isLastBatch = 7;</code>
     */
    public boolean getIsLastBatch() {
      return isLastBatch_;
    }

    private void initFields() {
      queryId_ = org.apache.drill.exec.proto.UserBitShared.QueryId.getDefaultInstance();
      receivingMajorFragmentId_ = 0;
      receivingMinorFragmentId_ = java.util.Collections.emptyList();
      sendingMajorFragmentId_ = 0;
      sendingMinorFragmentId_ = 0;
      def_ = org.apache.drill.exec.proto.UserBitShared.RecordBatchDef.getDefaultInstance();
      isLastBatch_ = false;
    }
    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized != -1) return isInitialized == 1;

      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        output.writeMessage(1, queryId_);
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        output.writeInt32(2, receivingMajorFragmentId_);
      }
      for (int i = 0; i < receivingMinorFragmentId_.size(); i++) {
        output.writeInt32(3, receivingMinorFragmentId_.get(i));
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        output.writeInt32(4, sendingMajorFragmentId_);
      }
      if (((bitField0_ & 0x00000008) == 0x00000008)) {
        output.writeInt32(5, sendingMinorFragmentId_);
      }
      if (((bitField0_ & 0x00000010) == 0x00000010)) {
        output.writeMessage(6, def_);
      }
      if (((bitField0_ & 0x00000020) == 0x00000020)) {
        output.writeBool(7, isLastBatch_);
      }
      getUnknownFields().writeTo(output);
    }

    private int memoizedSerializedSize = -1;
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(1, queryId_);
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt32Size(2, receivingMajorFragmentId_);
      }
      {
        int dataSize = 0;
        for (int i = 0; i < receivingMinorFragmentId_.size(); i++) {
          dataSize += com.google.protobuf.CodedOutputStream
            .computeInt32SizeNoTag(receivingMinorFragmentId_.get(i));
        }
        size += dataSize;
        size += 1 * getReceivingMinorFragmentIdList().size();
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt32Size(4, sendingMajorFragmentId_);
      }
      if (((bitField0_ & 0x00000008) == 0x00000008)) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt32Size(5, sendingMinorFragmentId_);
      }
      if (((bitField0_ & 0x00000010) == 0x00000010)) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(6, def_);
      }
      if (((bitField0_ & 0x00000020) == 0x00000020)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBoolSize(7, isLastBatch_);
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    protected java.lang.Object writeReplace()
        throws java.io.ObjectStreamException {
      return super.writeReplace();
    }

    public static org.apache.drill.exec.proto.BitData.FragmentRecordBatch parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static org.apache.drill.exec.proto.BitData.FragmentRecordBatch parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static org.apache.drill.exec.proto.BitData.FragmentRecordBatch parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static org.apache.drill.exec.proto.BitData.FragmentRecordBatch parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static org.apache.drill.exec.proto.BitData.FragmentRecordBatch parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static org.apache.drill.exec.proto.BitData.FragmentRecordBatch parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }
    public static org.apache.drill.exec.proto.BitData.FragmentRecordBatch parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input);
    }
    public static org.apache.drill.exec.proto.BitData.FragmentRecordBatch parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input, extensionRegistry);
    }
    public static org.apache.drill.exec.proto.BitData.FragmentRecordBatch parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static org.apache.drill.exec.proto.BitData.FragmentRecordBatch parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }

    public static Builder newBuilder() { return Builder.create(); }
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder(org.apache.drill.exec.proto.BitData.FragmentRecordBatch prototype) {
      return newBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() { return newBuilder(this); }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code exec.bit.data.FragmentRecordBatch}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder>
       implements org.apache.drill.exec.proto.BitData.FragmentRecordBatchOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return org.apache.drill.exec.proto.BitData.internal_static_exec_bit_data_FragmentRecordBatch_descriptor;
      }

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return org.apache.drill.exec.proto.BitData.internal_static_exec_bit_data_FragmentRecordBatch_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                org.apache.drill.exec.proto.BitData.FragmentRecordBatch.class, org.apache.drill.exec.proto.BitData.FragmentRecordBatch.Builder.class);
      }

      // Construct using org.apache.drill.exec.proto.BitData.FragmentRecordBatch.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
          getQueryIdFieldBuilder();
          getDefFieldBuilder();
        }
      }
      private static Builder create() {
        return new Builder();
      }

      public Builder clear() {
        super.clear();
        if (queryIdBuilder_ == null) {
          queryId_ = org.apache.drill.exec.proto.UserBitShared.QueryId.getDefaultInstance();
        } else {
          queryIdBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000001);
        receivingMajorFragmentId_ = 0;
        bitField0_ = (bitField0_ & ~0x00000002);
        receivingMinorFragmentId_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000004);
        sendingMajorFragmentId_ = 0;
        bitField0_ = (bitField0_ & ~0x00000008);
        sendingMinorFragmentId_ = 0;
        bitField0_ = (bitField0_ & ~0x00000010);
        if (defBuilder_ == null) {
          def_ = org.apache.drill.exec.proto.UserBitShared.RecordBatchDef.getDefaultInstance();
        } else {
          defBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000020);
        isLastBatch_ = false;
        bitField0_ = (bitField0_ & ~0x00000040);
        return this;
      }

      public Builder clone() {
        return create().mergeFrom(buildPartial());
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return org.apache.drill.exec.proto.BitData.internal_static_exec_bit_data_FragmentRecordBatch_descriptor;
      }

      public org.apache.drill.exec.proto.BitData.FragmentRecordBatch getDefaultInstanceForType() {
        return org.apache.drill.exec.proto.BitData.FragmentRecordBatch.getDefaultInstance();
      }

      public org.apache.drill.exec.proto.BitData.FragmentRecordBatch build() {
        org.apache.drill.exec.proto.BitData.FragmentRecordBatch result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public org.apache.drill.exec.proto.BitData.FragmentRecordBatch buildPartial() {
        org.apache.drill.exec.proto.BitData.FragmentRecordBatch result = new org.apache.drill.exec.proto.BitData.FragmentRecordBatch(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
          to_bitField0_ |= 0x00000001;
        }
        if (queryIdBuilder_ == null) {
          result.queryId_ = queryId_;
        } else {
          result.queryId_ = queryIdBuilder_.build();
        }
        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
          to_bitField0_ |= 0x00000002;
        }
        result.receivingMajorFragmentId_ = receivingMajorFragmentId_;
        if (((bitField0_ & 0x00000004) == 0x00000004)) {
          receivingMinorFragmentId_ = java.util.Collections.unmodifiableList(receivingMinorFragmentId_);
          bitField0_ = (bitField0_ & ~0x00000004);
        }
        result.receivingMinorFragmentId_ = receivingMinorFragmentId_;
        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
          to_bitField0_ |= 0x00000004;
        }
        result.sendingMajorFragmentId_ = sendingMajorFragmentId_;
        if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
          to_bitField0_ |= 0x00000008;
        }
        result.sendingMinorFragmentId_ = sendingMinorFragmentId_;
        if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
          to_bitField0_ |= 0x00000010;
        }
        if (defBuilder_ == null) {
          result.def_ = def_;
        } else {
          result.def_ = defBuilder_.build();
        }
        if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
          to_bitField0_ |= 0x00000020;
        }
        result.isLastBatch_ = isLastBatch_;
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof org.apache.drill.exec.proto.BitData.FragmentRecordBatch) {
          return mergeFrom((org.apache.drill.exec.proto.BitData.FragmentRecordBatch)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(org.apache.drill.exec.proto.BitData.FragmentRecordBatch other) {
        if (other == org.apache.drill.exec.proto.BitData.FragmentRecordBatch.getDefaultInstance()) return this;
        if (other.hasQueryId()) {
          mergeQueryId(other.getQueryId());
        }
        if (other.hasReceivingMajorFragmentId()) {
          setReceivingMajorFragmentId(other.getReceivingMajorFragmentId());
        }
        if (!other.receivingMinorFragmentId_.isEmpty()) {
          if (receivingMinorFragmentId_.isEmpty()) {
            receivingMinorFragmentId_ = other.receivingMinorFragmentId_;
            bitField0_ = (bitField0_ & ~0x00000004);
          } else {
            ensureReceivingMinorFragmentIdIsMutable();
            receivingMinorFragmentId_.addAll(other.receivingMinorFragmentId_);
          }
          onChanged();
        }
        if (other.hasSendingMajorFragmentId()) {
          setSendingMajorFragmentId(other.getSendingMajorFragmentId());
        }
        if (other.hasSendingMinorFragmentId()) {
          setSendingMinorFragmentId(other.getSendingMinorFragmentId());
        }
        if (other.hasDef()) {
          mergeDef(other.getDef());
        }
        if (other.hasIsLastBatch()) {
          setIsLastBatch(other.getIsLastBatch());
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }

      public final boolean isInitialized() {
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        org.apache.drill.exec.proto.BitData.FragmentRecordBatch parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (org.apache.drill.exec.proto.BitData.FragmentRecordBatch) e.getUnfinishedMessage();
          throw e;
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      // optional .exec.shared.QueryId query_id = 1;
      private org.apache.drill.exec.proto.UserBitShared.QueryId queryId_ = org.apache.drill.exec.proto.UserBitShared.QueryId.getDefaultInstance();
      private com.google.protobuf.SingleFieldBuilder<
          org.apache.drill.exec.proto.UserBitShared.QueryId, org.apache.drill.exec.proto.UserBitShared.QueryId.Builder, org.apache.drill.exec.proto.UserBitShared.QueryIdOrBuilder> queryIdBuilder_;
      /**
       * <code>optional .exec.shared.QueryId query_id = 1;</code>
       */
      public boolean hasQueryId() {
        return ((bitField0_ & 0x00000001) == 0x00000001);
      }
      /**
       * <code>optional .exec.shared.QueryId query_id = 1;</code>
       */
      public org.apache.drill.exec.proto.UserBitShared.QueryId getQueryId() {
        if (queryIdBuilder_ == null) {
          return queryId_;
        } else {
          return queryIdBuilder_.getMessage();
        }
      }
      /**
       * <code>optional .exec.shared.QueryId query_id = 1;</code>
       */
      public Builder setQueryId(org.apache.drill.exec.proto.UserBitShared.QueryId value) {
        if (queryIdBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          queryId_ = value;
          onChanged();
        } else {
          queryIdBuilder_.setMessage(value);
        }
        bitField0_ |= 0x00000001;
        return this;
      }
      /**
       * <code>optional .exec.shared.QueryId query_id = 1;</code>
       */
      public Builder setQueryId(
          org.apache.drill.exec.proto.UserBitShared.QueryId.Builder builderForValue) {
        if (queryIdBuilder_ == null) {
          queryId_ = builderForValue.build();
          onChanged();
        } else {
          queryIdBuilder_.setMessage(builderForValue.build());
        }
        bitField0_ |= 0x00000001;
        return this;
      }
      /**
       * <code>optional .exec.shared.QueryId query_id = 1;</code>
       */
      public Builder mergeQueryId(org.apache.drill.exec.proto.UserBitShared.QueryId value) {
        if (queryIdBuilder_ == null) {
          if (((bitField0_ & 0x00000001) == 0x00000001) &&
              queryId_ != org.apache.drill.exec.proto.UserBitShared.QueryId.getDefaultInstance()) {
            queryId_ =
              org.apache.drill.exec.proto.UserBitShared.QueryId.newBuilder(queryId_).mergeFrom(value).buildPartial();
          } else {
            queryId_ = value;
          }
          onChanged();
        } else {
          queryIdBuilder_.mergeFrom(value);
        }
        bitField0_ |= 0x00000001;
        return this;
      }
      /**
       * <code>optional .exec.shared.QueryId query_id = 1;</code>
       */
      public Builder clearQueryId() {
        if (queryIdBuilder_ == null) {
          queryId_ = org.apache.drill.exec.proto.UserBitShared.QueryId.getDefaultInstance();
          onChanged();
        } else {
          queryIdBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000001);
        return this;
      }
      /**
       * <code>optional .exec.shared.QueryId query_id = 1;</code>
       */
      public org.apache.drill.exec.proto.UserBitShared.QueryId.Builder getQueryIdBuilder() {
        bitField0_ |= 0x00000001;
        onChanged();
        return getQueryIdFieldBuilder().getBuilder();
      }
      /**
       * <code>optional .exec.shared.QueryId query_id = 1;</code>
       */
      public org.apache.drill.exec.proto.UserBitShared.QueryIdOrBuilder getQueryIdOrBuilder() {
        if (queryIdBuilder_ != null) {
          return queryIdBuilder_.getMessageOrBuilder();
        } else {
          return queryId_;
        }
      }
      /**
       * <code>optional .exec.shared.QueryId query_id = 1;</code>
       */
      private com.google.protobuf.SingleFieldBuilder<
          org.apache.drill.exec.proto.UserBitShared.QueryId, org.apache.drill.exec.proto.UserBitShared.QueryId.Builder, org.apache.drill.exec.proto.UserBitShared.QueryIdOrBuilder> 
          getQueryIdFieldBuilder() {
        if (queryIdBuilder_ == null) {
          queryIdBuilder_ = new com.google.protobuf.SingleFieldBuilder<
              org.apache.drill.exec.proto.UserBitShared.QueryId, org.apache.drill.exec.proto.UserBitShared.QueryId.Builder, org.apache.drill.exec.proto.UserBitShared.QueryIdOrBuilder>(
                  queryId_,
                  getParentForChildren(),
                  isClean());
          queryId_ = null;
        }
        return queryIdBuilder_;
      }

      // optional int32 receiving_major_fragment_id = 2;
      private int receivingMajorFragmentId_ ;
      /**
       * <code>optional int32 receiving_major_fragment_id = 2;</code>
       */
      public boolean hasReceivingMajorFragmentId() {
        return ((bitField0_ & 0x00000002) == 0x00000002);
      }
      /**
       * <code>optional int32 receiving_major_fragment_id = 2;</code>
       */
      public int getReceivingMajorFragmentId() {
        return receivingMajorFragmentId_;
      }
      /**
       * <code>optional int32 receiving_major_fragment_id = 2;</code>
       */
      public Builder setReceivingMajorFragmentId(int value) {
        bitField0_ |= 0x00000002;
        receivingMajorFragmentId_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional int32 receiving_major_fragment_id = 2;</code>
       */
      public Builder clearReceivingMajorFragmentId() {
        bitField0_ = (bitField0_ & ~0x00000002);
        receivingMajorFragmentId_ = 0;
        onChanged();
        return this;
      }

      // repeated int32 receiving_minor_fragment_id = 3;
      private java.util.List<java.lang.Integer> receivingMinorFragmentId_ = java.util.Collections.emptyList();
      private void ensureReceivingMinorFragmentIdIsMutable() {
        if (!((bitField0_ & 0x00000004) == 0x00000004)) {
          receivingMinorFragmentId_ = new java.util.ArrayList<java.lang.Integer>(receivingMinorFragmentId_);
          bitField0_ |= 0x00000004;
         }
      }
      /**
       * <code>repeated int32 receiving_minor_fragment_id = 3;</code>
       */
      public java.util.List<java.lang.Integer>
          getReceivingMinorFragmentIdList() {
        return java.util.Collections.unmodifiableList(receivingMinorFragmentId_);
      }
      /**
       * <code>repeated int32 receiving_minor_fragment_id = 3;</code>
       */
      public int getReceivingMinorFragmentIdCount() {
        return receivingMinorFragmentId_.size();
      }
      /**
       * <code>repeated int32 receiving_minor_fragment_id = 3;</code>
       */
      public int getReceivingMinorFragmentId(int index) {
        return receivingMinorFragmentId_.get(index);
      }
      /**
       * <code>repeated int32 receiving_minor_fragment_id = 3;</code>
       */
      public Builder setReceivingMinorFragmentId(
          int index, int value) {
        ensureReceivingMinorFragmentIdIsMutable();
        receivingMinorFragmentId_.set(index, value);
        onChanged();
        return this;
      }
      /**
       * <code>repeated int32 receiving_minor_fragment_id = 3;</code>
       */
      public Builder addReceivingMinorFragmentId(int value) {
        ensureReceivingMinorFragmentIdIsMutable();
        receivingMinorFragmentId_.add(value);
        onChanged();
        return this;
      }
      /**
       * <code>repeated int32 receiving_minor_fragment_id = 3;</code>
       */
      public Builder addAllReceivingMinorFragmentId(
          java.lang.Iterable<? extends java.lang.Integer> values) {
        ensureReceivingMinorFragmentIdIsMutable();
        super.addAll(values, receivingMinorFragmentId_);
        onChanged();
        return this;
      }
      /**
       * <code>repeated int32 receiving_minor_fragment_id = 3;</code>
       */
      public Builder clearReceivingMinorFragmentId() {
        receivingMinorFragmentId_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000004);
        onChanged();
        return this;
      }

      // optional int32 sending_major_fragment_id = 4;
      private int sendingMajorFragmentId_ ;
      /**
       * <code>optional int32 sending_major_fragment_id = 4;</code>
       */
      public boolean hasSendingMajorFragmentId() {
        return ((bitField0_ & 0x00000008) == 0x00000008);
      }
      /**
       * <code>optional int32 sending_major_fragment_id = 4;</code>
       */
      public int getSendingMajorFragmentId() {
        return sendingMajorFragmentId_;
      }
      /**
       * <code>optional int32 sending_major_fragment_id = 4;</code>
       */
      public Builder setSendingMajorFragmentId(int value) {
        bitField0_ |= 0x00000008;
        sendingMajorFragmentId_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional int32 sending_major_fragment_id = 4;</code>
       */
      public Builder clearSendingMajorFragmentId() {
        bitField0_ = (bitField0_ & ~0x00000008);
        sendingMajorFragmentId_ = 0;
        onChanged();
        return this;
      }

      // optional int32 sending_minor_fragment_id = 5;
      private int sendingMinorFragmentId_ ;
      /**
       * <code>optional int32 sending_minor_fragment_id = 5;</code>
       */
      public boolean hasSendingMinorFragmentId() {
        return ((bitField0_ & 0x00000010) == 0x00000010);
      }
      /**
       * <code>optional int32 sending_minor_fragment_id = 5;</code>
       */
      public int getSendingMinorFragmentId() {
        return sendingMinorFragmentId_;
      }
      /**
       * <code>optional int32 sending_minor_fragment_id = 5;</code>
       */
      public Builder setSendingMinorFragmentId(int value) {
        bitField0_ |= 0x00000010;
        sendingMinorFragmentId_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional int32 sending_minor_fragment_id = 5;</code>
       */
      public Builder clearSendingMinorFragmentId() {
        bitField0_ = (bitField0_ & ~0x00000010);
        sendingMinorFragmentId_ = 0;
        onChanged();
        return this;
      }

      // optional .exec.shared.RecordBatchDef def = 6;
      private org.apache.drill.exec.proto.UserBitShared.RecordBatchDef def_ = org.apache.drill.exec.proto.UserBitShared.RecordBatchDef.getDefaultInstance();
      private com.google.protobuf.SingleFieldBuilder<
          org.apache.drill.exec.proto.UserBitShared.RecordBatchDef, org.apache.drill.exec.proto.UserBitShared.RecordBatchDef.Builder, org.apache.drill.exec.proto.UserBitShared.RecordBatchDefOrBuilder> defBuilder_;
      /**
       * <code>optional .exec.shared.RecordBatchDef def = 6;</code>
       */
      public boolean hasDef() {
        return ((bitField0_ & 0x00000020) == 0x00000020);
      }
      /**
       * <code>optional .exec.shared.RecordBatchDef def = 6;</code>
       */
      public org.apache.drill.exec.proto.UserBitShared.RecordBatchDef getDef() {
        if (defBuilder_ == null) {
          return def_;
        } else {
          return defBuilder_.getMessage();
        }
      }
      /**
       * <code>optional .exec.shared.RecordBatchDef def = 6;</code>
       */
      public Builder setDef(org.apache.drill.exec.proto.UserBitShared.RecordBatchDef value) {
        if (defBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          def_ = value;
          onChanged();
        } else {
          defBuilder_.setMessage(value);
        }
        bitField0_ |= 0x00000020;
        return this;
      }
      /**
       * <code>optional .exec.shared.RecordBatchDef def = 6;</code>
       */
      public Builder setDef(
          org.apache.drill.exec.proto.UserBitShared.RecordBatchDef.Builder builderForValue) {
        if (defBuilder_ == null) {
          def_ = builderForValue.build();
          onChanged();
        } else {
          defBuilder_.setMessage(builderForValue.build());
        }
        bitField0_ |= 0x00000020;
        return this;
      }
      /**
       * <code>optional .exec.shared.RecordBatchDef def = 6;</code>
       */
      public Builder mergeDef(org.apache.drill.exec.proto.UserBitShared.RecordBatchDef value) {
        if (defBuilder_ == null) {
          if (((bitField0_ & 0x00000020) == 0x00000020) &&
              def_ != org.apache.drill.exec.proto.UserBitShared.RecordBatchDef.getDefaultInstance()) {
            def_ =
              org.apache.drill.exec.proto.UserBitShared.RecordBatchDef.newBuilder(def_).mergeFrom(value).buildPartial();
          } else {
            def_ = value;
          }
          onChanged();
        } else {
          defBuilder_.mergeFrom(value);
        }
        bitField0_ |= 0x00000020;
        return this;
      }
      /**
       * <code>optional .exec.shared.RecordBatchDef def = 6;</code>
       */
      public Builder clearDef() {
        if (defBuilder_ == null) {
          def_ = org.apache.drill.exec.proto.UserBitShared.RecordBatchDef.getDefaultInstance();
          onChanged();
        } else {
          defBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000020);
        return this;
      }
      /**
       * <code>optional .exec.shared.RecordBatchDef def = 6;</code>
       */
      public org.apache.drill.exec.proto.UserBitShared.RecordBatchDef.Builder getDefBuilder() {
        bitField0_ |= 0x00000020;
        onChanged();
        return getDefFieldBuilder().getBuilder();
      }
      /**
       * <code>optional .exec.shared.RecordBatchDef def = 6;</code>
       */
      public org.apache.drill.exec.proto.UserBitShared.RecordBatchDefOrBuilder getDefOrBuilder() {
        if (defBuilder_ != null) {
          return defBuilder_.getMessageOrBuilder();
        } else {
          return def_;
        }
      }
      /**
       * <code>optional .exec.shared.RecordBatchDef def = 6;</code>
       */
      private com.google.protobuf.SingleFieldBuilder<
          org.apache.drill.exec.proto.UserBitShared.RecordBatchDef, org.apache.drill.exec.proto.UserBitShared.RecordBatchDef.Builder, org.apache.drill.exec.proto.UserBitShared.RecordBatchDefOrBuilder> 
          getDefFieldBuilder() {
        if (defBuilder_ == null) {
          defBuilder_ = new com.google.protobuf.SingleFieldBuilder<
              org.apache.drill.exec.proto.UserBitShared.RecordBatchDef, org.apache.drill.exec.proto.UserBitShared.RecordBatchDef.Builder, org.apache.drill.exec.proto.UserBitShared.RecordBatchDefOrBuilder>(
                  def_,
                  getParentForChildren(),
                  isClean());
          def_ = null;
        }
        return defBuilder_;
      }

      // optional bool isLastBatch = 7;
      private boolean isLastBatch_ ;
      /**
       * <code>optional bool isLastBatch = 7;</code>
       */
      public boolean hasIsLastBatch() {
        return ((bitField0_ & 0x00000040) == 0x00000040);
      }
      /**
       * <code>optional bool isLastBatch = 7;</code>
       */
      public boolean getIsLastBatch() {
        return isLastBatch_;
      }
      /**
       * <code>optional bool isLastBatch = 7;</code>
       */
      public Builder setIsLastBatch(boolean value) {
        bitField0_ |= 0x00000040;
        isLastBatch_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional bool isLastBatch = 7;</code>
       */
      public Builder clearIsLastBatch() {
        bitField0_ = (bitField0_ & ~0x00000040);
        isLastBatch_ = false;
        onChanged();
        return this;
      }

      // @@protoc_insertion_point(builder_scope:exec.bit.data.FragmentRecordBatch)
    }

    static {
      defaultInstance = new FragmentRecordBatch(true);
      defaultInstance.initFields();
    }

    // @@protoc_insertion_point(class_scope:exec.bit.data.FragmentRecordBatch)
  }

  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_exec_bit_data_BitClientHandshake_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_exec_bit_data_BitClientHandshake_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_exec_bit_data_BitServerHandshake_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_exec_bit_data_BitServerHandshake_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_exec_bit_data_FragmentRecordBatch_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_exec_bit_data_FragmentRecordBatch_fieldAccessorTable;

  public static com.google.protobuf.Descriptors.FileDescriptor
      getDescriptor() {
    return descriptor;
  }
  private static com.google.protobuf.Descriptors.FileDescriptor
      descriptor;
  static {
    java.lang.String[] descriptorData = {
      "\n\rBitData.proto\022\rexec.bit.data\032\025Executio" +
      "nProtos.proto\032\022Coordination.proto\032\023UserB" +
      "itShared.proto\"]\n\022BitClientHandshake\022\023\n\013" +
      "rpc_version\030\001 \001(\005\0222\n\007channel\030\002 \001(\0162\027.exe" +
      "c.shared.RpcChannel:\010BIT_DATA\"K\n\022BitServ" +
      "erHandshake\022\023\n\013rpc_version\030\001 \001(\005\022 \n\030auth" +
      "enticationMechanisms\030\002 \003(\t\"\214\002\n\023FragmentR" +
      "ecordBatch\022&\n\010query_id\030\001 \001(\0132\024.exec.shar" +
      "ed.QueryId\022#\n\033receiving_major_fragment_i" +
      "d\030\002 \001(\005\022#\n\033receiving_minor_fragment_id\030\003",
      " \003(\005\022!\n\031sending_major_fragment_id\030\004 \001(\005\022" +
      "!\n\031sending_minor_fragment_id\030\005 \001(\005\022(\n\003de" +
      "f\030\006 \001(\0132\033.exec.shared.RecordBatchDef\022\023\n\013" +
      "isLastBatch\030\007 \001(\010*V\n\007RpcType\022\r\n\tHANDSHAK" +
      "E\020\000\022\007\n\003ACK\020\001\022\013\n\007GOODBYE\020\002\022\024\n\020REQ_RECORD_" +
      "BATCH\020\003\022\020\n\014SASL_MESSAGE\020\004B(\n\033org.apache." +
      "drill.exec.protoB\007BitDataH\001"
    };
    com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
      new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
        public com.google.protobuf.ExtensionRegistry assignDescriptors(
            com.google.protobuf.Descriptors.FileDescriptor root) {
          descriptor = root;
          internal_static_exec_bit_data_BitClientHandshake_descriptor =
            getDescriptor().getMessageTypes().get(0);
          internal_static_exec_bit_data_BitClientHandshake_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_exec_bit_data_BitClientHandshake_descriptor,
              new java.lang.String[] { "RpcVersion", "Channel", });
          internal_static_exec_bit_data_BitServerHandshake_descriptor =
            getDescriptor().getMessageTypes().get(1);
          internal_static_exec_bit_data_BitServerHandshake_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_exec_bit_data_BitServerHandshake_descriptor,
              new java.lang.String[] { "RpcVersion", "AuthenticationMechanisms", });
          internal_static_exec_bit_data_FragmentRecordBatch_descriptor =
            getDescriptor().getMessageTypes().get(2);
          internal_static_exec_bit_data_FragmentRecordBatch_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_exec_bit_data_FragmentRecordBatch_descriptor,
              new java.lang.String[] { "QueryId", "ReceivingMajorFragmentId", "ReceivingMinorFragmentId", "SendingMajorFragmentId", "SendingMinorFragmentId", "Def", "IsLastBatch", });
          return null;
        }
      };
    com.google.protobuf.Descriptors.FileDescriptor
      .internalBuildGeneratedFileFrom(descriptorData,
        new com.google.protobuf.Descriptors.FileDescriptor[] {
          org.apache.drill.exec.proto.ExecProtos.getDescriptor(),
          org.apache.drill.exec.proto.CoordinationProtos.getDescriptor(),
          org.apache.drill.exec.proto.UserBitShared.getDescriptor(),
        }, assigner);
  }

  // @@protoc_insertion_point(outer_class_scope)
}
